#!/bin/bash

#实时处理 res_notoil 表
#sh /home/marvin/realtime_job/sql/select/res_notoil_select.sh  |awk -F '\t' -f /home/marvin/realtime_job/awk/res_notoil.awk >/home/marvin/realtime_job/sql/replace/res_notoil_replace.sql
#mysql -uroot  -proot </home/marvin/realtime_job/sql/replace/res_notoil_replace.sql
sh /home/marvin/realtime_job/sql/select/res_notoil_select.sh |awk ' NR !=1 {print "INSERT into result.res_notoil VALUES('\''"$1,$2"'\'',","'\''"$3"'\'',"$4",",$5") on duplicate key update notoilNumber="$4",notoilMoney="$5";"}'>/home/marvin/realtime_job/mysql/res_notoil_insert.sql
mysql -uroot  -proot </home/marvin/realtime_job/mysql/res_notoil_insert.sql

mysql -uroot  -proot -e "replace into result.res_update(res_table) VALUES('res_notoil')"
